//
//  SandLampCollectionCell.m
//  YIJU2.0-HD
//
//  Created by 陈柏兵 on 16/5/9.
//  Copyright © 2016年 张金国. All rights reserved.
//

#import "SandLampCollectionCell.h"
#import "Masonry.h"

@implementation SandLampCollectionCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupConstraints];
    }
    return self;
}

- (void)setupConstraints {
    [self.lampView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top);
        make.left.equalTo(self.mas_left);
        make.width.equalTo(self.mas_width);
        make.height.equalTo(self.mas_height);
    }];
}

- (SettingSandTableLampView *)lampView {
    if (_lampView == nil) {
        _lampView = [[SettingSandTableLampView alloc] initWithDetailArray:self.dataArray];
        _lampView.backgroundColor = [UIColor randomColor];
        [self addSubview:_lampView];
    }
    return _lampView;
}

- (void)setTitleString:(NSString *)titleString {
    _titleString = titleString;
    _lampView.titleString = titleString;
}

@end
